try:  # 尝试执行的代码块
    num = int(input("请输入一个整数: "))
    result = 8 / num
    print(result)
except Exception as e:  # 捕获所有异常后执行的代码块
    print(f"捕获的异常类型有: {e}")